const {reslove}=require ('path')
// const htmlWebpackPligin=require('html-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')

module.export={
  ectry:'./src/index.ts',
  output:{
    path:reslove(__dirname,'./build'),
    filename:'js/bundle.js',
    clear:true
  },
  mode:'development',
  module:{
    rules:[
      {
        test:/\.tsx?$/,
        loader:'ts-loader'
      }
    ]
  },
  resolve:{
    extensions:[".ts",".tsx",".js"]
  },
  plugins:[
    new HtmlWebpackPlugin({
      template:'./public/index.html'
    })
  ],
  devServer:{
    port:3000,
    open:true,
    hot:true
  }
}